//
//  NetWorkManager+Travel.m
//  Go!
//
//  Created by 凌風 on 16/7/12.
//  Copyright © 2016年 凌风. All rights reserved.
//

#import "NetWorkManager+Travel.h"

@implementation NetWorkManager (Travel)

+ (void)acquireShopInfoWithPage:(NSString *)page
                     subcat_ids:(NSString *)subcatId
                   SuccessBlock:(void(^)(id responseObj)) successBlock
                   FailureBlock:(void(^)(NSError *error)) failureBlock {
    [self getWithURL:@"searchshops" urlParam:@{@"city_id":@"800010000", @"cat_ids":@"377", @"subcat_ids":subcatId, @"page":@"1", @"page_size":@"15", @"deals_per_shop":@"15"} successBlock:^(id responseObject) {
        
        
        if ([responseObject[@"msg"] isEqualToString:@"success"]) {
            
            if (successBlock) {
                successBlock(responseObject);
            }
            
        }
//        NSLog(@"%@", responseObject);
        
    } FailureBlock:^(NSError *error) {
        
    }];
}

+ (void)acquireShopDetailInfoWithShopID:(NSString *)shopID
                           SuccessBlock:(void(^)(id responseObj)) successBlock
                           FailureBlock:(void(^)(NSError *error)) failureBlock {
    [self getWithURL:@"shopinfo" urlParam:@{@"shop_id":shopID} successBlock:^(id responseObject) {
        
        if ([responseObject[@"msg"] isEqualToString:@"success"]) {
            
            if (successBlock) {
                successBlock(responseObject);
            }
            
        }
        
//        NSLOG(responseObject);
        
    } FailureBlock:^(NSError *error) {
        
    }];
}

+ (void)acquireShopDealsWithShopID:(NSString *)shopID
                           SuccessBlock:(void(^)(id responseObj)) successBlock
                           FailureBlock:(void(^)(NSError *error)) failureBlock {
    [self getWithURL:@"shopdeals" urlParam:@{@"shop_id":shopID} successBlock:^(id responseObject) {
        
        if ([responseObject[@"msg"] isEqualToString:@"success"]) {
            
            if (successBlock) {
                successBlock(responseObject);
            }
            
        }
        
        //        NSLOG(responseObject);
        
    } FailureBlock:^(NSError *error) {
        
    }];
}


@end
